﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using QxFramework.Core;
using System;
public class BLPointer : EffectBase
{
    string followItemName = default;
    private Transform t;


    public override void OnDisplay(Vector3 pos, object arg = null)
    {
        base.OnDisplay(pos, arg);
        var info = arg as Tuple<string, float>;
        this.transform.localScale = Vector3.one * info.Item2;
        followItemName = info.Item1;
    }
    public void OnEnable()
    {
        if (ClockManager.Get<IItemSyncManager>().GetGameObjectByName(followItemName) != null)
        {
            t = ClockManager.Get<IItemSyncManager>().GetGameObjectByName(followItemName).transform;
            transform.SetParent(t);
            transform.localEulerAngles = new Vector3(0, 0, 0);
        }
    }
}